package examples.shooterDemo;

import graphic.Assets;
import model.Coordinate;
import model.entity.Entity2D;

public class ShootedBullet extends Entity2D {
	
	private int shiftAmount;
	public ShootedBullet( int entityID, Coordinate coordinate, int shiftAmount) {
		super(entityID, coordinate, shiftAmount);
		this.shiftAmount = shiftAmount;
		setSprite(Assets.getsLoader().getSprite(Assets.SPRITE_SHOOTED_BULLET));
	}

	@Override
	public boolean perform() {
		Coordinate bulletCoo = getCoordinate();
		int newY = bulletCoo.getY()+shiftAmount;
		if( newY >  -(getSprite().getHeight() ) ){
			bulletCoo.setY(newY);
		}
		
		//Smetto di aggiornare la posizione.
		//Non eliminare per evitare problemi con la nave.
		return false;
	}
	
	@Override
	public boolean haveChild() {
		return false;
	}
}
